function main(serial_number,details)
    picture_name="frame"+num2str(serial_number)+"(1).jpg";
    disp(picture_name);
    I=imread(picture_name);
    figure
    %subplot(2,2,1),
    imshow(I);
    thresh = 0.27;
    % thresh = graythresh(I);    % 自动确定二值化阈值
    disp("thresh:");
    disp(thresh);
    I1 = imbinarize(I,thresh);    % 对图像二值化
    % subplot(2,2,2),
    figure;
    imshow(I1);

    % attempt
    rad=11;
    I1=imdilate(I1,strel('disk',rad));

    I2=~I1; % 对二值化图片求反片

    if details~=0
        figure
        subplot(2,2,3),
        imshow(I2);
    end

    [L1,num1] = bwlabel(I2,8);  % 对联通区域进行标记


    S=regionprops(L1,'Area');  % 标记区域 
    P1=regionprops(L1,'Perimeter'); % 标记区域的周长

    % attempt
    % 因为头部被腐蚀过 所以相应的面积也缩小了
    bw2 = ismember(L1, find([S.Area] >= 250 & [S.Area] <= 1000));

    if details~=0
        subplot(2,2,4);
        imshow(bw2);
    end

    [L2,num2] = bwlabel(bw2);
    disp(class(L2));
    S2=regionprops(L2,'Area');  % 标记区域 
    P2=regionprops(L2,'Perimeter');
    areas = cat(1, S2.Area);
    perimeters=cat(1, P2.Perimeter);
    circular=4*pi*areas./(perimeters.*perimeters);

    circular_threshhold_reached=find(circular>0.6);
    disp("circular_threshhold_reached");
    disp(circular_threshhold_reached);
    disp("size(L2)");
    disp(size(L2));


    circular_compare_temp=(L2~=(circular_threshhold_reached));


    L2(find(circular_compare_temp))=0;
    figure;
    imshow(L2);
    out_name=num2str(serial_number)+".out.jpg";
    disp(out_name);
    disp(":");
    imwrite(L2,out_name);
    % r=ismember(L1,find([P2.Perimeter./(2*(S2.Area*pi)^(1/2))]>0.6));
    % imshow(r);
end
